import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-anwise/supplier/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/blade-anwise/supplier/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-anwise/supplier/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-anwise/supplier/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/blade-anwise/supplier/submit',
    method: 'post',
    data: row
  })
}

export const remoteList = (supplierNo,type) => {
    return request({
        url: '/api/blade-anwise/supplier/remoteList?supplierNo='+supplierNo+"&type="+type,
        method: 'get',
        params: {}
    })
}

export const ownerList = (supplierNo,type,ownerId) => {
    return request({
        url: '/api/blade-anwise/supplier/ownerList?supplierNo='+supplierNo+"&type="+type+"&ownerId="+ownerId,
        method: 'get',
        params: {}
    })
}

export const select = () => {
  return request({
    url: '/api/blade-anwise/supplier/select',
    method: 'get',
    params: {}
  })
}


export const findSupplierByDeptId = (supType,deptId) => {
    return request({
        url: '/api/blade-anwise/supplier/findSupplierByDeptId',
        method: 'get',
        params: {supType,deptId}
    })
}

export const updateSupStatus = (row) => {
    return request({
        url: '/api/blade-anwise/supplier/updateSupStatus',
        method: 'post',
        data: row
    })
}

export const findListByOwner = (type,ownerId) => {
    return request({
        url: '/api/blade-anwise/supplier/findListByOwner?&type='+type+'&ownerId='+ownerId,
        method: 'get',
        params: {}
    })
}

